function GM_xmlhttpRequest(params)
{
  var req = new XMLHttpRequest();
  req.open("GET", "/proxy?url=" + encodeURIComponent(params.url));
  req.onreadystatechange = function(event) 
  {
    if(req.readyState == 4) 
    {
      if(req.status == 200)
      {
        req.finalUrl = req.getResponseHeader("X-Final-Url");
        params.onload(req);
      }
      else
      {
        params.onerror();
      }
    }
  };  
  req.send();
}